import axios from "axios";

const api = axios.create({
  baseURL: process.env.VUE_APP_API_BASE_URL || "http://localhost:3000",
  timeout: 30000,
});

export const uploadPdf = async (file) => {
  const formData = new FormData();
  formData.append("file", file);
  const response = await api.post("/api/upload", formData);
  return response.data;
};

export const uploadPdfUrl = async (url) => {
  const response = await api.post("/api/upload-url", { url });
  return response.data;
};

export const analyzeContent = async (content) => {
  const response = await api.post("/api/analyze", { content });
  return response.data;
};

export default api;
